<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><script type="text/javascript" src="https://cdn.jsdelivr.net/gh/opencobra/cobratoolbox@ffa0229fc0c01c9236bb7e961f65712443277719/latest/_static/js/iframeResizer.contentWindow.min.js"></script><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge,IE=9,chrome=1"><meta name="generator" content="MATLAB 2021a"><title>Proton shuttle testing with sparse flux balance analysis</title><style type="text/css">.rtcContent { padding: 30px; } .S0 { margin: 3px 10px 5px 4px; padding: 0px; line-height: 28.8px; min-height: 0px; white-space: normal; color: rgb(213, 80, 0); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 24px; font-weight: normal; text-align: left;  }
.S1 { margin: 20px 10px 5px 4px; padding: 0px; line-height: 20px; min-height: 0px; white-space: normal; color: rgb(60, 60, 60); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: bold; text-align: left;  }
.S2 { margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: normal; color: rgb(0, 0, 0); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: normal; text-align: left;  }
.S3 { margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: normal; color: rgb(0, 0, 0); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: normal; text-align: center;  }
.CodeBlock { background-color: #F7F7F7; margin: 10px 0 10px 0;}
.S4 { border-left: 1px solid rgb(233, 233, 233); border-right: 1px solid rgb(233, 233, 233); border-top: 1px solid rgb(233, 233, 233); border-bottom: 0px none rgb(0, 0, 0); border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 17.234px; min-height: 18px; white-space: nowrap; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px;  }
.S5 { border-left: 1px solid rgb(233, 233, 233); border-right: 1px solid rgb(233, 233, 233); border-top: 0px none rgb(0, 0, 0); border-bottom: 0px none rgb(0, 0, 0); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 17.234px; min-height: 18px; white-space: nowrap; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px;  }
.S6 { border-left: 1px solid rgb(233, 233, 233); border-right: 1px solid rgb(233, 233, 233); border-top: 0px none rgb(0, 0, 0); border-bottom: 1px solid rgb(233, 233, 233); border-radius: 0px 0px 4px 4px; padding: 0px 45px 4px 13px; line-height: 17.234px; min-height: 18px; white-space: nowrap; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px;  }
.S7 { border-left: 1px solid rgb(233, 233, 233); border-right: 1px solid rgb(233, 233, 233); border-top: 1px solid rgb(233, 233, 233); border-bottom: 1px solid rgb(233, 233, 233); border-radius: 4px; padding: 6px 45px 4px 13px; line-height: 17.234px; min-height: 18px; white-space: nowrap; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px;  }
.S8 { border-left: 1px solid rgb(233, 233, 233); border-right: 1px solid rgb(233, 233, 233); border-top: 0px none rgb(0, 0, 0); border-bottom: 1px solid rgb(233, 233, 233); border-radius: 0px; padding: 0px 45px 4px 13px; line-height: 17.234px; min-height: 18px; white-space: nowrap; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px;  }
.S9 { color: rgb(64, 64, 64); padding: 10px 0px 6px 17px; background: rgb(255, 255, 255) none repeat scroll 0% 0% / auto padding-box border-box; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px;  }
/* Styling that is common to warnings and errors is in diagnosticOutput.css */.embeddedOutputsErrorElement {    min-height: 18px;    max-height: 250px;    overflow: auto;}
.embeddedOutputsErrorElement.inlineElement {}
.embeddedOutputsErrorElement.rightPaneElement {}
/* Styling that is common to warnings and errors is in diagnosticOutput.css */.embeddedOutputsWarningElement{    min-height: 18px;    max-height: 250px;    overflow: auto;}
.embeddedOutputsWarningElement.inlineElement {}
.embeddedOutputsWarningElement.rightPaneElement {}
/* Copyright 2015-2019 The MathWorks, Inc. *//* In this file, styles are not scoped to rtcContainer since they could be in the Dojo Tooltip */.diagnosticMessage-wrapper {    font-family: Menlo, Monaco, Consolas, "Courier New", monospace;    font-size: 12px;}
.diagnosticMessage-wrapper.diagnosticMessage-warningType {    color: rgb(255,100,0);}
.diagnosticMessage-wrapper.diagnosticMessage-warningType a {    color: rgb(255,100,0);    text-decoration: underline;}
.diagnosticMessage-wrapper.diagnosticMessage-errorType {    color: rgb(230,0,0);}
.diagnosticMessage-wrapper.diagnosticMessage-errorType a {    color: rgb(230,0,0);    text-decoration: underline;}
.diagnosticMessage-wrapper .diagnosticMessage-messagePart,.diagnosticMessage-wrapper .diagnosticMessage-causePart {    white-space: normal;}
.diagnosticMessage-wrapper .diagnosticMessage-stackPart {    white-space: normal;}
.embeddedOutputsTextElement,.embeddedOutputsVariableStringElement {    white-space: normal;    word-wrap:  initial;    min-height: 18px;    max-height: 250px;    overflow: auto;}
.textElement,.rtcDataTipElement .textElement {    padding-top: 3px;}
.embeddedOutputsTextElement.inlineElement,.embeddedOutputsVariableStringElement.inlineElement {}
.inlineElement .textElement {}
.embeddedOutputsTextElement.rightPaneElement,.embeddedOutputsVariableStringElement.rightPaneElement {    min-height: 16px;}
.rightPaneElement .textElement {    padding-top: 2px;    padding-left: 9px;}
.S10 { margin: 10px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: normal; color: rgb(0, 0, 0); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: normal; text-align: left;  }
.S11 { border-left: 1px solid rgb(233, 233, 233); border-right: 1px solid rgb(233, 233, 233); border-top: 1px solid rgb(233, 233, 233); border-bottom: 1px solid rgb(233, 233, 233); border-radius: 4px 4px 0px 0px; padding: 6px 45px 4px 13px; line-height: 17.234px; min-height: 18px; white-space: nowrap; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px;  }</style></head><body><div class = rtcContent><h1  class = 'S0'><span>Proton shuttle testing with sparse flux balance analysis</span></h1><h2  class = 'S1'><span>Author: Ronan Fleming, Ines Thiele, University of Luxembourg.</span></h2><h2  class = 'S1'><span>Reviewer:</span></h2><h2  class = 'S1'><span>INTRODUCTION</span></h2><div  class = 'S2'><span>We consider a biochemical network of </span><span> </span><span>m</span><span> </span><span> molecular species and </span><span> </span><span>n</span><span> </span><span> biochemical reactions. The biochemical network is mathematically represented by a stoichiometric matrix </span><span texencoding="S\in\mathcal{Z}^{m\times n}" style="vertical-align:-5px"><img src="" width="63.5" height="19" /></span><span>. In standard notation, flux balance analysis (FBA) is the linear optimisation problem</span></div><div  class = 'S3'><span texencoding="\begin{array}{ll}
\min\limits _{v} &amp; \rho(v)\equiv c^{T}v\\
\text{s.t.} &amp; Sv=b,\\
 &amp; l\leq v\leq u,
\end{array}" style="vertical-align:-30px"><img src="" width="103.5" height="72" /></span></div><div  class = 'S2'><span>where </span><span texencoding="$c\in\Re^{n}$" style="vertical-align:-5px"><img src="" width="46.5" height="19" /></span><span> is a parameter vector that linearly combines one or more reaction fluxes to form what is termed the objective function,  and where a </span><span texencoding="$b_{i}&lt;0$" style="vertical-align:-6px"><img src="" width="39.5" height="20" /></span><span>, or  </span><span texencoding="$b_{i}&gt;0$" style="vertical-align:-6px"><img src="" width="39.5" height="20" /></span><span>, represents some fixed output, or input, of the ith molecular species. A typical application of flux balance analysis is to predict an optimal non-equilibrium steady-state flux vector that optimises a linear objective function, such biomass production rate, subject to bounds on certain reaction rates. </span></div><div  class = 'S2'><span>In this tutorial, we demonstrate how to predict the minimal number of active reactions that are still consistent with an optimal objective derived from the result of a standard flux balance analysis problem. In each case, the corresponding problem is a cardinality minimisation problem that we term </span><span style=' font-style: italic;'>sparse flux balance analysis</span></div><div  class = 'S3'><span texencoding="\begin{array}{ll}
\min\limits _{v} &amp; \Vert v\Vert_{0}\\
\text{s.t.} &amp; Sv=b\\
 &amp; l\leq v\leq u\\
 &amp; c^{T}v=\rho^{\star}
\end{array}" style="vertical-align:-41px"><img src="" width="94" height="93" /></span></div><div  class = 'S2'><span>where the last constraint is optional and represents the requirement to satisfy an optimal objective value </span><span texencoding="\rho^{\star}" style="vertical-align:-5px"><img src="" width="18.5" height="19" /></span><span> </span><span> </span><span>derived from any solution to a flux balance analysis (FBA) problem. This approach is used to check for minimal sets of reactions that either should be active, or should not be active in a flux balance model that is representative of a biochemical network.</span></div><div  class = 'S2'><span>In particular, this tutoriall illustrates the use of sparse flux balance analysis to compute the minimal set of reactions that must be active to produce ATP</span></div><h2  class = 'S1'><span>TIMING</span></h2><div  class = 'S2'><span>A minimal solution to sparse flux balance analysis problem can be obtained in &lt; 10 seconds. The time consuming part is comparing the predictions with the biochemical literature to assess whether the predictions are consistent with biochemical network funcion or not, as such, the process of refining a model to increase its biochemical fidelity can take days or weeks.</span></div><h2  class = 'S1'><span>PROCEDURE</span></h2><h2  class = 'S1'><span>Loading and examining the properties of Recon3.0model</span></h2><div  class = 'S2'><span>We are going to focus here on testing the biochemical fidelity of Recon3.0model, so load it, unless it is already loaded into the workspace</span></div><div class="CodeBlock"><div class="inlineWrapper"><div  class = 'S4'><span style="white-space: normal"><span >clear </span><span style="color: rgb(2, 128, 9);">%model</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span style="color: rgb(14, 0, 255);">if </span><span >~exist(</span><span style="color: rgb(170, 4, 249);">'modelOrig'</span><span >,</span><span style="color: rgb(170, 4, 249);">'var'</span><span >)</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >    </span><span style="color: rgb(2, 128, 9);">%filename='Recon1.0';</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >    </span><span style="color: rgb(2, 128, 9);">%filename='Recon2.0';</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >    </span><span style="color: rgb(2, 128, 9);">%filename='Recon2.0model';</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >    </span><span style="color: rgb(2, 128, 9);">%filename='Recon2.04model';</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >    </span><span style="color: rgb(2, 128, 9);">%filename='HMR2.0'</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >    </span><span style="color: rgb(2, 128, 9);">%filename='Recon2.2model';</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >    </span><span style="color: rgb(2, 128, 9);">%filename='Recon3.0';</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >    filename=</span><span style="color: rgb(170, 4, 249);">'Recon3.0model'</span><span >;</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >    directory=</span><span style="color: rgb(170, 4, 249);">'~/work/sbgCloud/programReconstruction/projects/recon2models/data/reconXComparisonModels'</span><span >;</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >    model = loadIdentifiedModel(filename,directory);</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >    model.csense(1:size(model.S,1),1)=</span><span style="color: rgb(170, 4, 249);">'E'</span><span >;</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >    modelOrig = model;</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span style="color: rgb(14, 0, 255);">else</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >    model=modelOrig;</span></span></div></div><div class="inlineWrapper"><div  class = 'S6'><span style="white-space: normal"><span style="color: rgb(14, 0, 255);">end</span></span></div></div></div><h2  class = 'S1'><span>Setting the numerical tolerance</span></h2><div  class = 'S2'><span>Implementation of sparse flux balance analysis with any numerical optimisation solver, requires a tolerance to be set that distinguished between zero and non-zero flux, based on the numerical tolerance of the currently installed optimisation solver. Typically 1e-6 will suffice, except for multiscale models.</span></div><div class="CodeBlock"><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >feasTol = getCobraSolverParams(</span><span style="color: rgb(170, 4, 249);">'LP'</span><span >, </span><span style="color: rgb(170, 4, 249);">'feasTol'</span><span >);</span></span></div></div></div><h2  class = 'S1'><span>Testing for activity of ATP synthase with all exchanges closed</span></h2><div  class = 'S2'><span>Detect the ATP synthase reaction and if there is none already, add one.</span></div><div class="CodeBlock"><div class="inlineWrapper"><div  class = 'S4'><span style="white-space: normal"><span >atpsynthaseBool=strcmp(model.rxns,</span><span style="color: rgb(170, 4, 249);">'ATPS4mi'</span><span >) | strcmp(model.rxns,</span><span style="color: rgb(170, 4, 249);">'ATPS4m'</span><span >);</span><span style="color: rgb(2, 128, 9);">% | strcmp(model.rxns,'ATPM');</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span style="color: rgb(14, 0, 255);">if </span><span >~any(atpsynthaseBool)</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >    fprintf(</span><span style="color: rgb(170, 4, 249);">'Could not find ATP synthase reaction, adding one.'</span><span >)</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >    </span><span style="color: rgb(14, 0, 255);">if </span><span >~strcmp(filename,</span><span style="color: rgb(170, 4, 249);">'HMR2.0'</span><span >)</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >        </span><span style="color: rgb(2, 128, 9);">%model = addReaction(model, 'ATPMnew', 'h2o[c] + atp[c] -&gt; h[c] + adp[c] + pi[c]');</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >        model = addReaction(model, </span><span style="color: rgb(170, 4, 249);">'ATPS4m'</span><span >, </span><span style="color: rgb(170, 4, 249);">'4.0 h[c] + adp[m] + pi[m] -&gt; h2o[m] + 3.0 h[m] + atp[m]'</span><span >);</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >    </span><span style="color: rgb(14, 0, 255);">else</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >        </span><span style="color: rgb(2, 128, 9);">%model = addReaction(model, 'ATPMnew', 'm02040c + m01371c -&gt; m02039c + m01285c + m02751c');</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >        model = addReaction(model, </span><span style="color: rgb(170, 4, 249);">'ATPS4m'</span><span >, </span><span style="color: rgb(170, 4, 249);">'4.0 m02039c + m01285m + m02751m -&gt; m02040m + 3.0 m02039m + m01371m'</span><span >);</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >    </span><span style="color: rgb(14, 0, 255);">end</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >    atpsynthaseBool=strcmp(model.rxns,</span><span style="color: rgb(170, 4, 249);">'ATPS4m'</span><span >);</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >    fprintf(</span><span style="color: rgb(170, 4, 249);">'%s %s\n'</span><span >,model.rxns{atpsynthaseBool},</span><span style="color: rgb(170, 4, 249);">' is the ATP synthase reaction'</span><span >)</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span style="color: rgb(14, 0, 255);">else</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >    fprintf(</span><span style="color: rgb(170, 4, 249);">'%s %s\n'</span><span >,model.rxns{atpsynthaseBool},</span><span style="color: rgb(170, 4, 249);">' is the ATP synthase reaction'</span><span >)</span></span></div></div><div class="inlineWrapper outputs"><div  class = 'S8'><span style="white-space: normal"><span style="color: rgb(14, 0, 255);">end</span></span></div><div  class = 'S9'><div class="inlineElement eoOutputWrapper embeddedOutputsTextElement" uid="B0E9C65D" data-testid="output_0" data-width="420" data-height="18" data-hashorizontaloverflow="false" style="width: 450px; max-height: 261px; white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="textElement" style="white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;">ATPS4mi  is the ATP synthase reaction</div></div></div></div></div><div  class = 'S10'><span>Display the size of the  model</span></div><div class="CodeBlock"><div class="inlineWrapper"><div  class = 'S4'><span style="white-space: normal"><span >[nMet,nRxn] = size(model.S);</span></span></div></div><div class="inlineWrapper outputs"><div  class = 'S8'><span style="white-space: normal"><span >fprintf(</span><span style="color: rgb(170, 4, 249);">'%6s\t%6s\n'</span><span >,</span><span style="color: rgb(170, 4, 249);">'#mets'</span><span >,</span><span style="color: rgb(170, 4, 249);">'#rxns'</span><span >); fprintf(</span><span style="color: rgb(170, 4, 249);">'%6u\t%6u\t%s%s\n'</span><span >,nMet,nRxn,</span><span style="color: rgb(170, 4, 249);">' totals in '</span><span >, model.modelID)</span></span></div><div  class = 'S9'><div class="inlineElement eoOutputWrapper embeddedOutputsTextElement" uid="D58393DB" data-testid="output_1" data-width="420" data-height="31" data-hashorizontaloverflow="false" style="width: 450px; max-height: 261px; white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="textElement" style="white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"> #mets	 #rxns
  5835	 10600	 totals in Recon3model</div></div></div></div></div><div  class = 'S10'><span>Display the constraints</span></div><div class="CodeBlock"><div class="inlineWrapper"><div  class = 'S4'><span style="white-space: normal"><span >minInf = -1000;</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >maxInf =  1000;</span></span></div></div><div class="inlineWrapper outputs"><div  class = 'S8'><span style="white-space: normal"><span >printConstraints(model, minInf, maxInf);</span></span></div><div  class = 'S9'><div class="inlineElement eoOutputWrapper embeddedOutputsTextElement" uid="E5248A95" data-testid="output_2" data-width="420" data-height="31" data-hashorizontaloverflow="false" style="width: 450px; max-height: 261px; white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="textElement" style="white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;">MinConstraints:
maxConstraints:</div></div></div></div></div><div  class = 'S2'><span>Identify the exchange reactions(s) heuristically</span></div><div class="CodeBlock"><div class="inlineWrapper"><div  class = 'S4'><span style="white-space: normal"><span style="color: rgb(14, 0, 255);">if </span><span >~isfield(model,</span><span style="color: rgb(170, 4, 249);">'SIntRxnBool'</span><span >)</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >    model = findSExRxnInd(model,size(model.S,1),1);</span></span></div></div><div class="inlineWrapper"><div  class = 'S6'><span style="white-space: normal"><span style="color: rgb(14, 0, 255);">end</span></span></div></div></div><div  class = 'S10'><span>Maximise the atp synthase reaction</span></div><div class="CodeBlock"><div class="inlineWrapper"><div  class = 'S4'><span style="white-space: normal"><span >model.c(:)=0;</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >model.c(atpsynthaseBool)=1;</span></span></div></div><div class="inlineWrapper"><div  class = 'S6'><span style="white-space: normal"><span >osenseStr=</span><span style="color: rgb(170, 4, 249);">'max'</span><span >;</span></span></div></div></div><div  class = 'S10'><span>Choose to minimize the zero norm of the optimal flux vector</span></div><div class="CodeBlock"><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >minNorm=</span><span style="color: rgb(170, 4, 249);">'zero'</span><span >;</span></span></div></div></div><div  class = 'S10'><span>Allow thermodynamically infeasible fluxes</span></div><div class="CodeBlock"><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >allowLoops=1;</span></span></div></div></div><div  class = 'S10'><span>Select the approximate step functions when minimising the zero norm of the flux vector</span></div><div class="CodeBlock"><div class="inlineWrapper"><div  class = 'S4'><span style="white-space: normal"><span style="color: rgb(2, 128, 9);">% zeroNormApprox='cappedL1';% : Capped-L1 norm</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span style="color: rgb(2, 128, 9);">% zeroNormApprox='exp';%Exponential function</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span style="color: rgb(2, 128, 9);">% zeroNormApprox='log';%Logarithmic function</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span style="color: rgb(2, 128, 9);">% zeroNormApprox='SCAD';%Smoothly clipped absolute deviation function</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span style="color: rgb(2, 128, 9);">% zeroNormApprox='lp-';%L_p norm with p&lt;0</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span style="color: rgb(2, 128, 9);">% zeroNormApprox='lp+';%L_p norm with 0&lt;p&lt;1</span></span></div></div><div class="inlineWrapper"><div  class = 'S6'><span style="white-space: normal"><span >zeroNormApprox=</span><span style="color: rgb(170, 4, 249);">'all'</span><span >;</span><span style="color: rgb(2, 128, 9);">% test all approximations avialable and return the best one</span></span></div></div></div><div  class = 'S10'><span>Close all external reactions</span></div><div class="CodeBlock"><div class="inlineWrapper"><div  class = 'S4'><span style="white-space: normal"><span >model.lb(~model.SIntRxnBool)=0;</span></span></div></div><div class="inlineWrapper"><div  class = 'S6'><span style="white-space: normal"><span >model.ub(~model.SIntRxnBool)=0;</span></span></div></div></div><div  class = 'S10'><span>Run sparse flux balance analysis on the model with all exchanges closed</span></div><div class="CodeBlock"><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >sparseFBAsolutionBounded = optimizeCbModel(model, osenseStr, minNorm, allowLoops, zeroNormApprox);</span></span></div></div></div><div  class = 'S10'><span>Check to see if there is a non-zero flux through the ATP synthase reaction</span></div><div class="CodeBlock"><div class="inlineWrapper outputs"><div  class = 'S11'><span style="white-space: normal"><span >fprintf(</span><span style="color: rgb(170, 4, 249);">'%g%s\n'</span><span >,sparseFBAsolutionBounded.v(atpsynthaseBool),</span><span style="color: rgb(170, 4, 249);">' flux through the ATP synthase reaction'</span><span >)</span></span></div><div  class = 'S9'><div class="inlineElement eoOutputWrapper embeddedOutputsTextElement" uid="B10E5EC0" data-testid="output_3" data-width="420" data-height="18" data-hashorizontaloverflow="false" style="width: 450px; max-height: 261px; white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="textElement" style="white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;">0 flux through the ATP synthase reaction</div></div></div></div></div><div  class = 'S10'><span>Display the sparse flux solution, but only the non-zero fluxes, above a specified cutoff.</span></div><div class="CodeBlock"><div class="inlineWrapper"><div  class = 'S4'><span style="white-space: normal"><span >cutoff=feasTol;</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span style="color: rgb(14, 0, 255);">for </span><span >n=1:nRxn</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >    </span><span style="color: rgb(14, 0, 255);">if </span><span >abs(sparseFBAsolutionBounded.v(n))&gt;cutoff</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >        formula=printRxnFormula(model, model.rxns{n}, 0);</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >        fprintf(</span><span style="color: rgb(170, 4, 249);">'%10g%15s\t%-60s\n'</span><span >,sparseFBAsolutionBounded.v(n),model.rxns{n}, formula{1});</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >    </span><span style="color: rgb(14, 0, 255);">end</span></span></div></div><div class="inlineWrapper"><div  class = 'S6'><span style="white-space: normal"><span style="color: rgb(14, 0, 255);">end</span></span></div></div></div><h2  class = 'S1'><span>ANTICIPATED RESULTS</span></h2><div  class = 'S2'><span>In a model for flux balance analysis, there should be zero flux through the ATP synthase reaction if all external reaction bounds are zero.</span></div><h2  class = 'S1'><span>TROUBLESHOOTING</span></h2><div  class = 'S2'><span>If there is non-zero flux through the ATP synthase reaction, with all external reaction bounds zero, then the bounds on one of the reactions in each of the minimal sets needs to be set to eliminate flux in one direction. Each of the minimal sets corresponds to net flux around a stoichiometrically balanced cycle, which is thermodynamically infeasible [</span><a href = "#LyXCite-fleming_variational_2012"><span style=' text-decoration: underline;'>fleming_variational_2012</span></a><span>]. Steady-state mass balance constraints do not enforce thermodynamic constraints. In lieu of such constraints, the bounds on reactions can be set based on the biochemical literature to eliminate net flux around a stoichiometrically balanced cycle. In a model, with all external reactions blocked (bounds are set to zero), maximising the ATP synthase reaction while minimising the cardinality of all internal reactions, using sparse flux balance analysis can be used to find any such cycle of minimal cardinality (minimal number of active reactions). By further constraining the bounds to convert one reversible reaction in each such cycle to an irreversible reaction, thermodynamically infeasible flux around cycles, such as those involving the ATP synthase reaction, can be eliminated. The following sections of this tutorial illustrate how to test different parts of the model for thermodynamically infeasible flux through the ATP synthase reaction.</span></div><h2  class = 'S1'><span>Testing for activity of ATP synthase with all exchanges closed and all internal reactions reversible</span></h2><div  class = 'S2'><span>Fully open all internal reactions</span></div><div class="CodeBlock"><div class="inlineWrapper"><div  class = 'S4'><span style="white-space: normal"><span >model.lb(model.SIntRxnBool)=-1000;</span></span></div></div><div class="inlineWrapper"><div  class = 'S6'><span style="white-space: normal"><span >model.ub(model.SIntRxnBool)=1000;</span></span></div></div></div><div  class = 'S10'><span>Run sparse flux balance analysis on the model with all exchanges closed and all internal reactions reversible</span></div><div class="CodeBlock"><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >sparseFBAsolutionUnBounded = optimizeCbModel(model, osenseStr, minNorm, allowLoops, zeroNormApprox);</span></span></div></div></div><div  class = 'S10'><span>Check to see if there is a non-zero flux through the ATP synthase reaction</span></div><div class="CodeBlock"><div class="inlineWrapper outputs"><div  class = 'S11'><span style="white-space: normal"><span >fprintf(</span><span style="color: rgb(170, 4, 249);">'%g%s\n'</span><span >,sparseFBAsolutionUnBounded.v(atpsynthaseBool),</span><span style="color: rgb(170, 4, 249);">' flux through the ATP synthase reaction'</span><span >)</span></span></div><div  class = 'S9'><div class="inlineElement eoOutputWrapper embeddedOutputsTextElement" uid="8067A217" data-testid="output_4" data-width="420" data-height="18" data-hashorizontaloverflow="false" style="width: 450px; max-height: 261px; white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="textElement" style="white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;">1000 flux through the ATP synthase reaction</div></div></div></div></div><div  class = 'S10'><span>Display the sparse flux solution, but only the non-zero fluxes, above a specified cutoff.</span></div><div class="CodeBlock"><div class="inlineWrapper"><div  class = 'S4'><span style="white-space: normal"><span >cutoff=feasTol;</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span style="color: rgb(14, 0, 255);">for </span><span >n=1:nRxn</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >    </span><span style="color: rgb(14, 0, 255);">if </span><span >abs(sparseFBAsolutionUnBounded.v(n))&gt;cutoff</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >        formula=printRxnFormula(model, model.rxns{n}, 0);</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >        fprintf(</span><span style="color: rgb(170, 4, 249);">'%10g%15s\t%-60s\n'</span><span >,sparseFBAsolutionUnBounded.v(n),model.rxns{n}, formula{1});</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >    </span><span style="color: rgb(14, 0, 255);">end</span></span></div></div><div class="inlineWrapper outputs"><div  class = 'S8'><span style="white-space: normal"><span style="color: rgb(14, 0, 255);">end</span></span></div><div  class = 'S9'><div class="inlineElement eoOutputWrapper embeddedOutputsTextElement scrollableOutput" uid="A104BC41" data-testid="output_5" data-width="420" data-height="18" data-hashorizontaloverflow="true" style="width: 450px; max-height: 261px; white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="textElement" style="white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;">       400          ADK1m	atp[m] + amp[m]  &lt;=&gt; 2 adp[m]                               </div></div><div class="inlineElement eoOutputWrapper embeddedOutputsTextElement scrollableOutput" uid="F01DA030" data-testid="output_6" data-width="420" data-height="18" data-hashorizontaloverflow="true" style="width: 450px; max-height: 261px; white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="textElement" style="white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;">       200         G5SDym	h[m] + nadph[m] + glu5p[m]  &lt;=&gt; nadp[m] + pi[m] + glu5sa[m] </div></div><div class="inlineElement eoOutputWrapper embeddedOutputsTextElement scrollableOutput" uid="FD7AEDFB" data-testid="output_7" data-width="420" data-height="18" data-hashorizontaloverflow="true" style="width: 450px; max-height: 261px; white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="textElement" style="white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;">       200         GLU5Km	glu_L[m] + atp[m]  &lt;=&gt; adp[m] + glu5p[m]                    </div></div><div class="inlineElement eoOutputWrapper embeddedOutputsTextElement scrollableOutput" uid="FC970325" data-testid="output_8" data-width="420" data-height="18" data-hashorizontaloverflow="true" style="width: 450px; max-height: 261px; white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="textElement" style="white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;">      -200     P45027A15m	o2[m] + h[m] + nadph[m] + xol7ah3[m]  &lt;=&gt; 2 h2o[m] + nadp[m] + xol7ah2al[m] </div></div><div class="inlineElement eoOutputWrapper embeddedOutputsTextElement scrollableOutput" uid="76BC8D45" data-testid="output_9" data-width="420" data-height="18" data-hashorizontaloverflow="true" style="width: 450px; max-height: 261px; white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="textElement" style="white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;">       400           PPAm	h2o[m] + ppi[m]  &lt;=&gt; h[m] + 2 pi[m]                         </div></div><div class="inlineElement eoOutputWrapper embeddedOutputsTextElement scrollableOutput" uid="3FCECE4F" data-testid="output_10" data-width="420" data-height="18" data-hashorizontaloverflow="true" style="width: 450px; max-height: 261px; white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="textElement" style="white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;">       200          r0074	h2o[m] + nad[m] + glu5sa[m]  &lt;=&gt; 2 h[m] + nadh[m] + glu_L[m] </div></div><div class="inlineElement eoOutputWrapper embeddedOutputsTextElement scrollableOutput" uid="B5D4D144" data-testid="output_11" data-width="420" data-height="18" data-hashorizontaloverflow="true" style="width: 450px; max-height: 261px; white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="textElement" style="white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;">       200        RE1804M	nad[m] + xol7ah3[m]  &lt;=&gt; h[m] + nadh[m] + xol7ah2al[m]      </div></div><div class="inlineElement eoOutputWrapper embeddedOutputsTextElement scrollableOutput" uid="4C8DBBCC" data-testid="output_12" data-width="420" data-height="18" data-hashorizontaloverflow="true" style="width: 450px; max-height: 261px; white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="textElement" style="white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;">       400       HMR_3966	h2o[m] + atp[m]  &lt;=&gt; h[m] + amp[m] + ppi[m]                 </div></div><div class="inlineElement eoOutputWrapper embeddedOutputsTextElement scrollableOutput" uid="5F1AF7EC" data-testid="output_13" data-width="420" data-height="18" data-hashorizontaloverflow="true" style="width: 450px; max-height: 261px; white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="textElement" style="white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;">      1000        ATPS4mi	adp[m] + pi[m] + 4 h[i]  &lt;=&gt; h2o[m] + 3 h[m] + atp[m]       </div></div><div class="inlineElement eoOutputWrapper embeddedOutputsTextElement scrollableOutput" uid="474F41D0" data-testid="output_14" data-width="420" data-height="18" data-hashorizontaloverflow="true" style="width: 450px; max-height: 261px; white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="textElement" style="white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;">       400     CYOR_u10mi	2 h[m] + 2 ficytC[m] + q10h2[m]  &lt;=&gt; q10[m] + 2 focytC[m] + 4 h[i] </div></div><div class="inlineElement eoOutputWrapper embeddedOutputsTextElement scrollableOutput" uid="09F8EFD7" data-testid="output_15" data-width="420" data-height="18" data-hashorizontaloverflow="true" style="width: 450px; max-height: 261px; white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="textElement" style="white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;">       400    NADH2_u10mi	5 h[m] + nadh[m] + q10[m]  &lt;=&gt; nad[m] + q10h2[m] + 4 h[i]   </div></div><div class="inlineElement eoOutputWrapper embeddedOutputsTextElement scrollableOutput" uid="48B1E90F" data-testid="output_16" data-width="420" data-height="18" data-hashorizontaloverflow="true" style="width: 450px; max-height: 261px; white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="textElement" style="white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;">       200        CYOOm2i	o2[m] + 8 h[m] + 4 focytC[m]  &lt;=&gt; 2 h2o[m] + 4 ficytC[m] + 4 h[i] </div></div></div></div></div><h2  class = 'S1'><span>ANTICIPATED RESULTS</span></h2><div  class = 'S2'><span>In a model for flux balance analysis, there might be non-zero flux through the ATP synthase reaction if all external reaction bounds are zero and all internal reactions reversible. This indicates the imporance of appropriately constrained internal reaction bounds.</span></div><h2  class = 'S1'><span>Testing for activity of ATP synthase with all exchanges closed and all transport reactions reversible</span></h2><div  class = 'S2'><span>Identify all of the transport reactions</span></div><div class="CodeBlock"><div class="inlineWrapper"><div  class = 'S4'><span style="white-space: normal"><span >allTransportRxnBool=transportReactionBool(model);</span></span></div></div><div class="inlineWrapper outputs"><div  class = 'S8'><span style="white-space: normal"><span >fprintf(</span><span style="color: rgb(170, 4, 249);">'%u%s\n'</span><span >,nnz(allTransportRxnBool),</span><span style="color: rgb(170, 4, 249);">' transport reactions in total.'</span><span >);</span></span></div><div  class = 'S9'><div class="inlineElement eoOutputWrapper embeddedOutputsTextElement" uid="F6D493CE" data-testid="output_17" data-width="420" data-height="18" data-hashorizontaloverflow="false" style="width: 450px; max-height: 261px; white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="textElement" style="white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;">4230 transport reactions in total.</div></div></div></div></div><div  class = 'S10'><span>Revert to original Recon3.0model reaction bounds</span></div><div class="CodeBlock"><div class="inlineWrapper"><div  class = 'S4'><span style="white-space: normal"><span >model.lb=modelOrig.lb;</span></span></div></div><div class="inlineWrapper"><div  class = 'S6'><span style="white-space: normal"><span >model.ub=modelOrig.ub;</span></span></div></div></div><div  class = 'S10'><span>Open all transport reactions (which might include an external reaction, e.g., a  biomass reaction)</span></div><div class="CodeBlock"><div class="inlineWrapper"><div  class = 'S4'><span style="white-space: normal"><span >model.lb(allTransportRxnBool)=-1000;</span></span></div></div><div class="inlineWrapper"><div  class = 'S6'><span style="white-space: normal"><span >model.ub(allTransportRxnBool)=1000;</span></span></div></div></div><div  class = 'S10'><span>Close all external reactions</span></div><div class="CodeBlock"><div class="inlineWrapper"><div  class = 'S4'><span style="white-space: normal"><span >model.lb(~model.SIntRxnBool)=0;</span></span></div></div><div class="inlineWrapper"><div  class = 'S6'><span style="white-space: normal"><span >model.ub(~model.SIntRxnBool)=0;</span></span></div></div></div><div  class = 'S10'><span>Run sparse flux balance analysis on the model with all exchanges closed</span></div><div class="CodeBlock"><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >sparseFBAsolutionBounded = optimizeCbModel(model, osenseStr, minNorm, allowLoops, zeroNormApprox);</span></span></div></div></div><div  class = 'S10'><span>Check to see if there is a non-zero flux through the ATP synthase reaction</span></div><div class="CodeBlock"><div class="inlineWrapper outputs"><div  class = 'S11'><span style="white-space: normal"><span >fprintf(</span><span style="color: rgb(170, 4, 249);">'%g%s\n'</span><span >,sparseFBAsolutionBounded.v(atpsynthaseBool),</span><span style="color: rgb(170, 4, 249);">' flux through the ATP synthase reaction'</span><span >)</span></span></div><div  class = 'S9'><div class="inlineElement eoOutputWrapper embeddedOutputsTextElement" uid="069924D9" data-testid="output_18" data-width="420" data-height="18" data-hashorizontaloverflow="false" style="width: 450px; max-height: 261px; white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="textElement" style="white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;">1000 flux through the ATP synthase reaction</div></div></div></div></div><div  class = 'S10'><span>Display the sparse flux solution, but only the non-zero fluxes, above a specified cutoff.</span></div><div class="CodeBlock"><div class="inlineWrapper"><div  class = 'S4'><span style="white-space: normal"><span >cutoff=feasTol;</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span style="color: rgb(14, 0, 255);">for </span><span >n=1:nRxn</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >    </span><span style="color: rgb(14, 0, 255);">if </span><span >abs(sparseFBAsolutionBounded.v(n))&gt;cutoff</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >        formula=printRxnFormula(model, model.rxns{n}, 0);</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >        fprintf(</span><span style="color: rgb(170, 4, 249);">'%10g%15s\t%-60s\n'</span><span >,sparseFBAsolutionBounded.v(n),model.rxns{n}, formula{1});</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >    </span><span style="color: rgb(14, 0, 255);">end</span></span></div></div><div class="inlineWrapper outputs"><div  class = 'S8'><span style="white-space: normal"><span style="color: rgb(14, 0, 255);">end</span></span></div><div  class = 'S9'><div class="inlineElement eoOutputWrapper embeddedOutputsTextElement scrollableOutput" uid="1041251A" data-testid="output_19" data-width="420" data-height="18" data-hashorizontaloverflow="true" style="width: 450px; max-height: 261px; white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="textElement" style="white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;">       500          ADK1m	atp[m] + amp[m]  &lt;=&gt; 2 adp[m]                               </div></div><div class="inlineElement eoOutputWrapper embeddedOutputsTextElement scrollableOutput" uid="DA76393D" data-testid="output_20" data-width="420" data-height="18" data-hashorizontaloverflow="true" style="width: 450px; max-height: 261px; white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="textElement" style="white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;">       500         LDH_Lm	nad[m] + lac_L[m]  &lt;=&gt; h[m] + nadh[m] + pyr[m]              </div></div><div class="inlineElement eoOutputWrapper embeddedOutputsTextElement scrollableOutput" uid="DC416640" data-testid="output_21" data-width="420" data-height="18" data-hashorizontaloverflow="true" style="width: 450px; max-height: 261px; white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="textElement" style="white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;">      -500       L_LACDcm	2 ficytC[m] + lac_L[c]  &lt;=&gt; 2 h[c] + pyr[c] + 2 focytC[m]   </div></div><div class="inlineElement eoOutputWrapper embeddedOutputsTextElement scrollableOutput" uid="35FD35EB" data-testid="output_22" data-width="420" data-height="18" data-hashorizontaloverflow="true" style="width: 450px; max-height: 261px; white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="textElement" style="white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;">       500       L_LACtcm	lac_L[c]  &lt;=&gt; lac_L[m]                                      </div></div><div class="inlineElement eoOutputWrapper embeddedOutputsTextElement scrollableOutput" uid="487C269E" data-testid="output_23" data-width="420" data-height="18" data-hashorizontaloverflow="true" style="width: 450px; max-height: 261px; white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="textElement" style="white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;">       500           PPAm	h2o[m] + ppi[m]  -&gt; h[m] + 2 pi[m]                          </div></div><div class="inlineElement eoOutputWrapper embeddedOutputsTextElement scrollableOutput" uid="57BC68B5" data-testid="output_24" data-width="420" data-height="18" data-hashorizontaloverflow="true" style="width: 450px; max-height: 261px; white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="textElement" style="white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;">      -500         PYRt2m	h[c] + pyr[c]  &lt;=&gt; h[m] + pyr[m]                            </div></div><div class="inlineElement eoOutputWrapper embeddedOutputsTextElement scrollableOutput" uid="8A8BC9D8" data-testid="output_25" data-width="420" data-height="18" data-hashorizontaloverflow="true" style="width: 450px; max-height: 261px; white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="textElement" style="white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;">      -250          r2398	h[c] + lys_L[m] + citr_L[c]  &lt;=&gt; h[m] + lys_L[c] + citr_L[m] </div></div><div class="inlineElement eoOutputWrapper embeddedOutputsTextElement scrollableOutput" uid="7D573B68" data-testid="output_26" data-width="420" data-height="18" data-hashorizontaloverflow="true" style="width: 450px; max-height: 261px; white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="textElement" style="white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;">      -250          r2410	h[c] + lys_L[c] + citr_L[m]  &lt;=&gt; h[m] + lys_L[m] + citr_L[c] </div></div><div class="inlineElement eoOutputWrapper embeddedOutputsTextElement scrollableOutput" uid="3AE3D6E0" data-testid="output_27" data-width="420" data-height="18" data-hashorizontaloverflow="true" style="width: 450px; max-height: 261px; white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="textElement" style="white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;">       500       HMR_3966	h2o[m] + atp[m]  -&gt; h[m] + amp[m] + ppi[m]                  </div></div><div class="inlineElement eoOutputWrapper embeddedOutputsTextElement scrollableOutput" uid="5071A435" data-testid="output_28" data-width="420" data-height="18" data-hashorizontaloverflow="true" style="width: 450px; max-height: 261px; white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="textElement" style="white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;">      1000        ATPS4mi	adp[m] + pi[m] + 4 h[i]  &lt;=&gt; h2o[m] + 3 h[m] + atp[m]       </div></div><div class="inlineElement eoOutputWrapper embeddedOutputsTextElement scrollableOutput" uid="D49113E0" data-testid="output_29" data-width="420" data-height="18" data-hashorizontaloverflow="true" style="width: 450px; max-height: 261px; white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="textElement" style="white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;">       500     CYOR_u10mi	2 h[m] + 2 ficytC[m] + q10h2[m]  &lt;=&gt; q10[m] + 2 focytC[m] + 4 h[i] </div></div><div class="inlineElement eoOutputWrapper embeddedOutputsTextElement scrollableOutput" uid="FD2053DD" data-testid="output_30" data-width="420" data-height="18" data-hashorizontaloverflow="true" style="width: 450px; max-height: 261px; white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="textElement" style="white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;">       500    NADH2_u10mi	5 h[m] + nadh[m] + q10[m]  &lt;=&gt; nad[m] + q10h2[m] + 4 h[i]   </div></div></div></div></div><h2  class = 'S1'><span>Testing for activity of ATP synthase with all exchanges closed and all mitochondrial transport reactions reversible</span></h2><div  class = 'S2'><span>Identify all of the transport reactions involving the cytoplasm and mitochondrial matrix</span></div><div class="CodeBlock"><div class="inlineWrapper"><div  class = 'S4'><span style="white-space: normal"><span >originCompartment=</span><span style="color: rgb(170, 4, 249);">'c'</span><span >;</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >destinationCompartment=</span><span style="color: rgb(170, 4, 249);">'m'</span><span >;</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >unidirectionalBool=0;</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >cmTransportRxnBool=transportReactionBool(model,originCompartment,destinationCompartment,unidirectionalBool);</span></span></div></div><div class="inlineWrapper outputs"><div  class = 'S8'><span style="white-space: normal"><span >fprintf(</span><span style="color: rgb(170, 4, 249);">'%u%s\n'</span><span >,nnz(cmTransportRxnBool),</span><span style="color: rgb(170, 4, 249);">' transport reactions involving the cytoplasm and mitochondrial matrix.'</span><span >);</span></span></div><div  class = 'S9'><div class="inlineElement eoOutputWrapper embeddedOutputsTextElement scrollableOutput" uid="0933DE0A" data-testid="output_31" data-width="420" data-height="18" data-hashorizontaloverflow="true" style="width: 450px; max-height: 261px; white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="textElement" style="white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;">491 transport reactions involving the cytoplasm and mitochondrial matrix.</div></div></div></div></div><div  class = 'S10'><span>Revert to original Recon3.0model reaction bounds</span></div><div class="CodeBlock"><div class="inlineWrapper"><div  class = 'S4'><span style="white-space: normal"><span >model.lb=modelOrig.lb;</span></span></div></div><div class="inlineWrapper"><div  class = 'S6'><span style="white-space: normal"><span >model.ub=modelOrig.ub;</span></span></div></div></div><div  class = 'S10'><span>Open all transport reactions (which might include an external reaction, e.g., a  biomass reaction)</span></div><div class="CodeBlock"><div class="inlineWrapper"><div  class = 'S4'><span style="white-space: normal"><span >model.lb(cmTransportRxnBool)=-1000;</span></span></div></div><div class="inlineWrapper"><div  class = 'S6'><span style="white-space: normal"><span >model.ub(cmTransportRxnBool)=1000;</span></span></div></div></div><div  class = 'S10'><span>Close all external reactions</span></div><div class="CodeBlock"><div class="inlineWrapper"><div  class = 'S4'><span style="white-space: normal"><span >model.lb(~model.SIntRxnBool)=0;</span></span></div></div><div class="inlineWrapper"><div  class = 'S6'><span style="white-space: normal"><span >model.ub(~model.SIntRxnBool)=0;</span></span></div></div></div><div  class = 'S10'><span>Run sparse flux balance analysis on the model </span></div><div class="CodeBlock"><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >sparseFBAsolutionBounded = optimizeCbModel(model, osenseStr, minNorm, allowLoops, zeroNormApprox);</span></span></div></div></div><div  class = 'S10'><span>Check to see if there is a non-zero flux through the ATP synthase reaction</span></div><div class="CodeBlock"><div class="inlineWrapper outputs"><div  class = 'S11'><span style="white-space: normal"><span >fprintf(</span><span style="color: rgb(170, 4, 249);">'%g%s\n'</span><span >,sparseFBAsolutionBounded.v(atpsynthaseBool),</span><span style="color: rgb(170, 4, 249);">' flux through the ATP synthase reaction'</span><span >)</span></span></div><div  class = 'S9'><div class="inlineElement eoOutputWrapper embeddedOutputsTextElement" uid="F018AC77" data-testid="output_32" data-width="420" data-height="18" data-hashorizontaloverflow="false" style="width: 450px; max-height: 261px; white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="textElement" style="white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;">1000 flux through the ATP synthase reaction</div></div></div></div></div><div  class = 'S10'><span>Display the sparse flux solution, but only the non-zero fluxes, above a specified cutoff.</span></div><div class="CodeBlock"><div class="inlineWrapper"><div  class = 'S4'><span style="white-space: normal"><span >cutoff=feasTol;</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span style="color: rgb(14, 0, 255);">for </span><span >n=1:nRxn</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >    </span><span style="color: rgb(14, 0, 255);">if </span><span >abs(sparseFBAsolutionBounded.v(n))&gt;cutoff</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >        formula=printRxnFormula(model, model.rxns{n}, 0);</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >        fprintf(</span><span style="color: rgb(170, 4, 249);">'%10g%15s\t%-60s\n'</span><span >,sparseFBAsolutionBounded.v(n),model.rxns{n}, formula{1});</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >    </span><span style="color: rgb(14, 0, 255);">end</span></span></div></div><div class="inlineWrapper outputs"><div  class = 'S8'><span style="white-space: normal"><span style="color: rgb(14, 0, 255);">end</span></span></div><div  class = 'S9'><div class="inlineElement eoOutputWrapper embeddedOutputsTextElement scrollableOutput" uid="A8316674" data-testid="output_33" data-width="420" data-height="18" data-hashorizontaloverflow="true" style="width: 450px; max-height: 261px; white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="textElement" style="white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;">       500          ADK1m	atp[m] + amp[m]  &lt;=&gt; 2 adp[m]                               </div></div><div class="inlineElement eoOutputWrapper embeddedOutputsTextElement scrollableOutput" uid="22C6D44E" data-testid="output_34" data-width="420" data-height="18" data-hashorizontaloverflow="true" style="width: 450px; max-height: 261px; white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="textElement" style="white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;">       500         LDH_Lm	nad[m] + lac_L[m]  &lt;=&gt; h[m] + nadh[m] + pyr[m]              </div></div><div class="inlineElement eoOutputWrapper embeddedOutputsTextElement scrollableOutput" uid="9E078339" data-testid="output_35" data-width="420" data-height="18" data-hashorizontaloverflow="true" style="width: 450px; max-height: 261px; white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="textElement" style="white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;">      -500       L_LACDcm	2 ficytC[m] + lac_L[c]  &lt;=&gt; 2 h[c] + pyr[c] + 2 focytC[m]   </div></div><div class="inlineElement eoOutputWrapper embeddedOutputsTextElement scrollableOutput" uid="23A1FBF3" data-testid="output_36" data-width="420" data-height="18" data-hashorizontaloverflow="true" style="width: 450px; max-height: 261px; white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="textElement" style="white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;">       500       L_LACtcm	lac_L[c]  &lt;=&gt; lac_L[m]                                      </div></div><div class="inlineElement eoOutputWrapper embeddedOutputsTextElement scrollableOutput" uid="C085CB49" data-testid="output_37" data-width="420" data-height="18" data-hashorizontaloverflow="true" style="width: 450px; max-height: 261px; white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="textElement" style="white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;">       500           PPAm	h2o[m] + ppi[m]  -&gt; h[m] + 2 pi[m]                          </div></div><div class="inlineElement eoOutputWrapper embeddedOutputsTextElement scrollableOutput" uid="29C371C7" data-testid="output_38" data-width="420" data-height="18" data-hashorizontaloverflow="true" style="width: 450px; max-height: 261px; white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="textElement" style="white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;">      -500         PYRt2m	h[c] + pyr[c]  &lt;=&gt; h[m] + pyr[m]                            </div></div><div class="inlineElement eoOutputWrapper embeddedOutputsTextElement scrollableOutput" uid="2CFB4D11" data-testid="output_39" data-width="420" data-height="18" data-hashorizontaloverflow="true" style="width: 450px; max-height: 261px; white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="textElement" style="white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;">      -250          r2402	h[c] + arg_L[m] + citr_L[c]  &lt;=&gt; h[m] + arg_L[c] + citr_L[m] </div></div><div class="inlineElement eoOutputWrapper embeddedOutputsTextElement scrollableOutput" uid="94337435" data-testid="output_40" data-width="420" data-height="18" data-hashorizontaloverflow="true" style="width: 450px; max-height: 261px; white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="textElement" style="white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;">      -250          r2411	h[c] + arg_L[c] + citr_L[m]  &lt;=&gt; h[m] + arg_L[m] + citr_L[c] </div></div><div class="inlineElement eoOutputWrapper embeddedOutputsTextElement scrollableOutput" uid="970D1B47" data-testid="output_41" data-width="420" data-height="18" data-hashorizontaloverflow="true" style="width: 450px; max-height: 261px; white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="textElement" style="white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;">       500       HMR_3966	h2o[m] + atp[m]  -&gt; h[m] + amp[m] + ppi[m]                  </div></div><div class="inlineElement eoOutputWrapper embeddedOutputsTextElement scrollableOutput" uid="06CC848D" data-testid="output_42" data-width="420" data-height="18" data-hashorizontaloverflow="true" style="width: 450px; max-height: 261px; white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="textElement" style="white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;">      1000        ATPS4mi	adp[m] + pi[m] + 4 h[i]  -&gt; h2o[m] + 3 h[m] + atp[m]        </div></div><div class="inlineElement eoOutputWrapper embeddedOutputsTextElement scrollableOutput" uid="96B6D86E" data-testid="output_43" data-width="420" data-height="18" data-hashorizontaloverflow="true" style="width: 450px; max-height: 261px; white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="textElement" style="white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;">       500     CYOR_u10mi	2 h[m] + 2 ficytC[m] + q10h2[m]  -&gt; q10[m] + 2 focytC[m] + 4 h[i] </div></div><div class="inlineElement eoOutputWrapper embeddedOutputsTextElement scrollableOutput" uid="9615D4BB" data-testid="output_44" data-width="420" data-height="18" data-hashorizontaloverflow="true" style="width: 450px; max-height: 261px; white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="textElement" style="white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;">       500    NADH2_u10mi	5 h[m] + nadh[m] + q10[m]  -&gt; nad[m] + q10h2[m] + 4 h[i]    </div></div></div></div></div><h2  class = 'S1'><span>Testing for activity of ATP synthase with all exchanges closed and all plasma membrane transport reactions reversible</span></h2><div  class = 'S2'><span>Identify all of the transport reactions across the plasma membrane</span></div><div class="CodeBlock"><div class="inlineWrapper"><div  class = 'S4'><span style="white-space: normal"><span >originCompartment=</span><span style="color: rgb(170, 4, 249);">'e'</span><span >;</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >destinationCompartment=</span><span style="color: rgb(170, 4, 249);">'c'</span><span >;</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >unidirectionalBool=0;</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >ecTransportRxnBool=transportReactionBool(model,originCompartment,destinationCompartment,unidirectionalBool);</span></span></div></div><div class="inlineWrapper"><div  class = 'S6'><span style="white-space: normal"><span >fprintf(</span><span style="color: rgb(170, 4, 249);">'%u%s\n'</span><span >,nnz(ecTransportRxnBool),</span><span style="color: rgb(170, 4, 249);">' transport reactions across the plasma membrane.'</span><span >);</span></span></div></div></div><div  class = 'S10'><span>Revert to original Recon3.0model reaction bounds</span></div><div class="CodeBlock"><div class="inlineWrapper"><div  class = 'S4'><span style="white-space: normal"><span >model.lb=modelOrig.lb;</span></span></div></div><div class="inlineWrapper"><div  class = 'S6'><span style="white-space: normal"><span >model.ub=modelOrig.ub;</span></span></div></div></div><div  class = 'S10'><span>Open all transport reactions (which might include an external reaction, e.g., a  biomass reaction)</span></div><div class="CodeBlock"><div class="inlineWrapper"><div  class = 'S4'><span style="white-space: normal"><span >model.lb(ecTransportRxnBool)=-1000;</span></span></div></div><div class="inlineWrapper"><div  class = 'S6'><span style="white-space: normal"><span >model.ub(ecTransportRxnBool)=1000;</span></span></div></div></div><div  class = 'S10'><span>Close all external reactions</span></div><div class="CodeBlock"><div class="inlineWrapper"><div  class = 'S4'><span style="white-space: normal"><span >model.lb(~model.SIntRxnBool)=0;</span></span></div></div><div class="inlineWrapper"><div  class = 'S6'><span style="white-space: normal"><span >model.ub(~model.SIntRxnBool)=0;</span></span></div></div></div><div  class = 'S10'><span>Run sparse flux balance analysis on the model </span></div><div class="CodeBlock"><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >sparseFBAsolutionBounded = optimizeCbModel(model, osenseStr, minNorm, allowLoops, zeroNormApprox);</span></span></div></div></div><div  class = 'S10'><span>Check to see if there is a non-zero flux through the ATP synthase reaction</span></div><div class="CodeBlock"><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >fprintf(</span><span style="color: rgb(170, 4, 249);">'%g%s\n'</span><span >,sparseFBAsolutionBounded.v(atpsynthaseBool),</span><span style="color: rgb(170, 4, 249);">' flux through the ATP synthase reaction'</span><span >)</span></span></div></div></div><div  class = 'S10'><span>Display the sparse flux solution, but only the non-zero fluxes, above a specified cutoff.</span></div><div class="CodeBlock"><div class="inlineWrapper"><div  class = 'S4'><span style="white-space: normal"><span >cutoff=feasTol;</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span style="color: rgb(14, 0, 255);">for </span><span >n=1:nRxn</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >    </span><span style="color: rgb(14, 0, 255);">if </span><span >abs(sparseFBAsolutionBounded.v(n))&gt;cutoff</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >        formula=printRxnFormula(model, model.rxns{n}, 0);</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >        fprintf(</span><span style="color: rgb(170, 4, 249);">'%10g%15s\t%-60s\n'</span><span >,sparseFBAsolutionBounded.v(n),model.rxns{n}, formula{1});</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >    </span><span style="color: rgb(14, 0, 255);">end</span></span></div></div><div class="inlineWrapper"><div  class = 'S6'><span style="white-space: normal"><span style="color: rgb(14, 0, 255);">end</span></span></div></div></div><h2  class = 'S1'><span>Testing for activity of ATP synthase with all exchanges closed and peroxisomal transport reactions reversible</span></h2><div  class = 'S2'><span>Identify all of the transport reactions across the plasma membrane</span></div><div class="CodeBlock"><div class="inlineWrapper"><div  class = 'S4'><span style="white-space: normal"><span >originCompartment=</span><span style="color: rgb(170, 4, 249);">'c'</span><span >;</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >destinationCompartment=</span><span style="color: rgb(170, 4, 249);">'x'</span><span >;</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >unidirectionalBool=0;</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >cxTransportRxnBool=transportReactionBool(model,originCompartment,destinationCompartment,unidirectionalBool);</span></span></div></div><div class="inlineWrapper"><div  class = 'S6'><span style="white-space: normal"><span >fprintf(</span><span style="color: rgb(170, 4, 249);">'%u%s\n'</span><span >,nnz(cxTransportRxnBool),</span><span style="color: rgb(170, 4, 249);">' transport reactions across the peroxisome membrane.'</span><span >);</span></span></div></div></div><div  class = 'S10'><span>Revert to original Recon3.0model reaction bounds</span></div><div class="CodeBlock"><div class="inlineWrapper"><div  class = 'S4'><span style="white-space: normal"><span >model.lb=modelOrig.lb;</span></span></div></div><div class="inlineWrapper"><div  class = 'S6'><span style="white-space: normal"><span >model.ub=modelOrig.ub;</span></span></div></div></div><div  class = 'S10'><span>Open all transport reactions (which might include an external reaction, e.g., a  biomass reaction)</span></div><div class="CodeBlock"><div class="inlineWrapper"><div  class = 'S4'><span style="white-space: normal"><span >model.lb(cxTransportRxnBool)=-1000;</span></span></div></div><div class="inlineWrapper"><div  class = 'S6'><span style="white-space: normal"><span >model.ub(cxTransportRxnBool)=1000;</span></span></div></div></div><div  class = 'S10'><span>Close all external reactions</span></div><div class="CodeBlock"><div class="inlineWrapper"><div  class = 'S4'><span style="white-space: normal"><span >model.lb(~model.SIntRxnBool)=0;</span></span></div></div><div class="inlineWrapper"><div  class = 'S6'><span style="white-space: normal"><span >model.ub(~model.SIntRxnBool)=0;</span></span></div></div></div><div  class = 'S10'><span>Run sparse flux balance analysis on the model </span></div><div class="CodeBlock"><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >sparseFBAsolutionBounded = optimizeCbModel(model, osenseStr, minNorm, allowLoops, zeroNormApprox);</span></span></div></div></div><div  class = 'S10'><span>Check to see if there is a non-zero flux through the ATP synthase reaction</span></div><div class="CodeBlock"><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >fprintf(</span><span style="color: rgb(170, 4, 249);">'%g%s\n'</span><span >,sparseFBAsolutionBounded.v(atpsynthaseBool),</span><span style="color: rgb(170, 4, 249);">' flux through the ATP synthase reaction'</span><span >)</span></span></div></div></div><div  class = 'S10'><span>Display the sparse flux solution, but only the non-zero fluxes, above a specified cutoff.</span></div><div class="CodeBlock"><div class="inlineWrapper"><div  class = 'S4'><span style="white-space: normal"><span >cutoff=feasTol;</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span style="color: rgb(14, 0, 255);">for </span><span >n=1:nRxn</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >    </span><span style="color: rgb(14, 0, 255);">if </span><span >abs(sparseFBAsolutionBounded.v(n))&gt;cutoff</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >        formula=printRxnFormula(model, model.rxns{n}, 0);</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >        fprintf(</span><span style="color: rgb(170, 4, 249);">'%10g%15s\t%-60s\n'</span><span >,sparseFBAsolutionBounded.v(n),model.rxns{n}, formula{1});</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >    </span><span style="color: rgb(14, 0, 255);">end</span></span></div></div><div class="inlineWrapper"><div  class = 'S6'><span style="white-space: normal"><span style="color: rgb(14, 0, 255);">end</span></span></div></div></div><h2  class = 'S1'><span>Testing for activity of ATP synthase with all exchanges closed and lysosomal transport reactions reversible</span></h2><div  class = 'S2'><span>Identify all of the transport reactions across the plasma membrane</span></div><div class="CodeBlock"><div class="inlineWrapper"><div  class = 'S4'><span style="white-space: normal"><span >originCompartment=</span><span style="color: rgb(170, 4, 249);">'c'</span><span >;</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >destinationCompartment=</span><span style="color: rgb(170, 4, 249);">'l'</span><span >;</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >unidirectionalBool=0;</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >clTransportRxnBool=transportReactionBool(model,originCompartment,destinationCompartment,unidirectionalBool);</span></span></div></div><div class="inlineWrapper"><div  class = 'S6'><span style="white-space: normal"><span >fprintf(</span><span style="color: rgb(170, 4, 249);">'%u%s\n'</span><span >,nnz(clTransportRxnBool),</span><span style="color: rgb(170, 4, 249);">' transport reactions across the lysosomal membrane.'</span><span >);</span></span></div></div></div><div  class = 'S10'><span>Revert to original Recon3.0model reaction bounds</span></div><div class="CodeBlock"><div class="inlineWrapper"><div  class = 'S4'><span style="white-space: normal"><span >model.lb=modelOrig.lb;</span></span></div></div><div class="inlineWrapper"><div  class = 'S6'><span style="white-space: normal"><span >model.ub=modelOrig.ub;</span></span></div></div></div><div  class = 'S10'><span>Open all transport reactions (which might include an external reaction, e.g., a  biomass reaction)</span></div><div class="CodeBlock"><div class="inlineWrapper"><div  class = 'S4'><span style="white-space: normal"><span >model.lb(clTransportRxnBool)=-1000;</span></span></div></div><div class="inlineWrapper"><div  class = 'S6'><span style="white-space: normal"><span >model.ub(clTransportRxnBool)=1000;</span></span></div></div></div><div  class = 'S10'><span>Close all external reactions</span></div><div class="CodeBlock"><div class="inlineWrapper"><div  class = 'S4'><span style="white-space: normal"><span >model.lb(~model.SIntRxnBool)=0;</span></span></div></div><div class="inlineWrapper"><div  class = 'S6'><span style="white-space: normal"><span >model.ub(~model.SIntRxnBool)=0;</span></span></div></div></div><div  class = 'S10'><span>Run sparse flux balance analysis on the model </span></div><div class="CodeBlock"><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >sparseFBAsolutionBounded = optimizeCbModel(model, osenseStr, minNorm, allowLoops, zeroNormApprox);</span></span></div></div></div><div  class = 'S10'><span>Check to see if there is a non-zero flux through the ATP synthase reaction</span></div><div class="CodeBlock"><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >fprintf(</span><span style="color: rgb(170, 4, 249);">'%g%s\n'</span><span >,sparseFBAsolutionBounded.v(atpsynthaseBool),</span><span style="color: rgb(170, 4, 249);">' flux through the ATP synthase reaction'</span><span >)</span></span></div></div></div><div  class = 'S10'><span>Display the sparse flux solution, but only the non-zero fluxes, above a specified cutoff.</span></div><div class="CodeBlock"><div class="inlineWrapper"><div  class = 'S4'><span style="white-space: normal"><span >cutoff=feasTol;</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span style="color: rgb(14, 0, 255);">for </span><span >n=1:nRxn</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >    </span><span style="color: rgb(14, 0, 255);">if </span><span >abs(sparseFBAsolutionBounded.v(n))&gt;cutoff</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >        formula=printRxnFormula(model, model.rxns{n}, 0);</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >        fprintf(</span><span style="color: rgb(170, 4, 249);">'%10g%15s\t%-60s\n'</span><span >,sparseFBAsolutionBounded.v(n),model.rxns{n}, formula{1});</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >    </span><span style="color: rgb(14, 0, 255);">end</span></span></div></div><div class="inlineWrapper"><div  class = 'S6'><span style="white-space: normal"><span style="color: rgb(14, 0, 255);">end</span></span></div></div></div><h2  class = 'S1'><span>REFERENCES</span></h2><div  class = 'S2'><span>[fleming_cardinality_nodate] Fleming, R.M.T., et al., Cardinality optimisation in constraint-based modelling: illustration with Recon 3D (submitted), 2017.</span></div><div  class = 'S2'><span>[</span><a href = "#LyXCite-sparsePaper"><span style=' text-decoration: underline;'>sparsePaper</span></a><span>] Le Thi, H.A., Pham Dinh, T., Le, H.M., and Vo, X.T. (2015). DC approximation approaches for sparse</span><span> </span><span>optimization</span><span>. European Journal of Operational Research 244, 26–46.</span></div><div  class = 'S2'><span style=' font-style: italic;'></span></div><div  class = 'S2'></div>
<br>
<!-- 
##### SOURCE BEGIN #####
%% Proton shuttle testing with sparse flux balance analysis
%% Author: Ronan Fleming, Ines Thiele, University of Luxembourg.
%% Reviewer:
%% INTRODUCTION
% We consider a biochemical network of  m  molecular species and  n  biochemical 
% reactions. The biochemical network is mathematically represented by a stoichiometric 
% matrix $S\in\mathcal{Z}^{m\times n}$. In standard notation, flux balance analysis 
% (FBA) is the linear optimisation problem
% 
% $$\begin{array}{ll}\min\limits _{v} & \rho(v)\equiv c^{T}v\\\text{s.t.} & 
% Sv=b,\\ & l\leq v\leq u,\end{array}$$
% 
% where $$c\in\Re^{n}$$ is a parameter vector that linearly combines one or 
% more reaction fluxes to form what is termed the objective function,  and where 
% a $$b_{i}<0$$, or  $$b_{i}>0$$, represents some fixed output, or input, of the 
% ith molecular species. A typical application of flux balance analysis is to 
% predict an optimal non-equilibrium steady-state flux vector that optimises a 
% linear objective function, such biomass production rate, subject to bounds on 
% certain reaction rates. 
% 
% In this tutorial, we demonstrate how to predict the minimal number of active 
% reactions that are still consistent with an optimal objective derived from the 
% result of a standard flux balance analysis problem. In each case, the corresponding 
% problem is a cardinality minimisation problem that we term _sparse flux balance 
% analysis_
% 
% $$\begin{array}{ll}\min\limits _{v} & \Vert v\Vert_{0}\\\text{s.t.} & Sv=b\\ 
% & l\leq v\leq u\\ & c^{T}v=\rho^{\star}\end{array}$$
% 
% where the last constraint is optional and represents the requirement to satisfy 
% an optimal objective value $\rho^{\star}$  derived from any solution to a flux 
% balance analysis (FBA) problem. This approach is used to check for minimal sets 
% of reactions that either should be active, or should not be active in a flux 
% balance model that is representative of a biochemical network.
% 
% In particular, this tutoriall illustrates the use of sparse flux balance analysis 
% to compute the minimal set of reactions that must be active to produce ATP
%% TIMING
% A minimal solution to sparse flux balance analysis problem can be obtained 
% in < 10 seconds. The time consuming part is comparing the predictions with the 
% biochemical literature to assess whether the predictions are consistent with 
% biochemical network funcion or not, as such, the process of refining a model 
% to increase its biochemical fidelity can take days or weeks.
%% PROCEDURE
%% Loading and examining the properties of Recon3.0model
% We are going to focus here on testing the biochemical fidelity of Recon3.0model, 
% so load it, unless it is already loaded into the workspace

clear %model
if ~exist('modelOrig','var')
    %filename='Recon1.0';
    %filename='Recon2.0';
    %filename='Recon2.0model';
    %filename='Recon2.04model';
    %filename='HMR2.0'
    %filename='Recon2.2model';
    %filename='Recon3.0';
    filename='Recon3.0model';
    directory='~/work/sbgCloud/programReconstruction/projects/recon2models/data/reconXComparisonModels';
    model = loadIdentifiedModel(filename,directory);
    model.csense(1:size(model.S,1),1)='E';
    modelOrig = model;
else
    model=modelOrig;
end
%% Setting the numerical tolerance
% Implementation of sparse flux balance analysis with any numerical optimisation 
% solver, requires a tolerance to be set that distinguished between zero and non-zero 
% flux, based on the numerical tolerance of the currently installed optimisation 
% solver. Typically 1e-6 will suffice, except for multiscale models.

feasTol = getCobraSolverParams('LP', 'feasTol');
%% Testing for activity of ATP synthase with all exchanges closed
% Detect the ATP synthase reaction and if there is none already, add one.

atpsynthaseBool=strcmp(model.rxns,'ATPS4mi') | strcmp(model.rxns,'ATPS4m');% | strcmp(model.rxns,'ATPM');
if ~any(atpsynthaseBool)
    fprintf('Could not find ATP synthase reaction, adding one.')
    if ~strcmp(filename,'HMR2.0')
        %model = addReaction(model, 'ATPMnew', 'h2o[c] + atp[c] -> h[c] + adp[c] + pi[c]');
        model = addReaction(model, 'ATPS4m', '4.0 h[c] + adp[m] + pi[m] -> h2o[m] + 3.0 h[m] + atp[m]');
    else
        %model = addReaction(model, 'ATPMnew', 'm02040c + m01371c -> m02039c + m01285c + m02751c');
        model = addReaction(model, 'ATPS4m', '4.0 m02039c + m01285m + m02751m -> m02040m + 3.0 m02039m + m01371m');
    end
    atpsynthaseBool=strcmp(model.rxns,'ATPS4m');
    fprintf('%s %s\n',model.rxns{atpsynthaseBool},' is the ATP synthase reaction')
else
    fprintf('%s %s\n',model.rxns{atpsynthaseBool},' is the ATP synthase reaction')
end
%% 
% Display the size of the  model

[nMet,nRxn] = size(model.S);
fprintf('%6s\t%6s\n','#mets','#rxns'); fprintf('%6u\t%6u\t%s%s\n',nMet,nRxn,' totals in ', model.modelID)
%% 
% Display the constraints

minInf = -1000;
maxInf =  1000;
printConstraints(model, minInf, maxInf);
%% 
% Identify the exchange reactions(s) heuristically

if ~isfield(model,'SIntRxnBool')
    model = findSExRxnInd(model,size(model.S,1),1);
end
%% 
% Maximise the atp synthase reaction

model.c(:)=0;
model.c(atpsynthaseBool)=1;
osenseStr='max';
%% 
% Choose to minimize the zero norm of the optimal flux vector

minNorm='zero';
%% 
% Allow thermodynamically infeasible fluxes

allowLoops=1;
%% 
% Select the approximate step functions when minimising the zero norm of the 
% flux vector

% zeroNormApprox='cappedL1';% : Capped-L1 norm
% zeroNormApprox='exp';%Exponential function
% zeroNormApprox='log';%Logarithmic function
% zeroNormApprox='SCAD';%Smoothly clipped absolute deviation function
% zeroNormApprox='lp-';%L_p norm with p<0
% zeroNormApprox='lp+';%L_p norm with 0<p<1
zeroNormApprox='all';% test all approximations avialable and return the best one
%% 
% Close all external reactions

model.lb(~model.SIntRxnBool)=0;
model.ub(~model.SIntRxnBool)=0;
%% 
% Run sparse flux balance analysis on the model with all exchanges closed

sparseFBAsolutionBounded = optimizeCbModel(model, osenseStr, minNorm, allowLoops, zeroNormApprox);
%% 
% Check to see if there is a non-zero flux through the ATP synthase reaction

fprintf('%g%s\n',sparseFBAsolutionBounded.v(atpsynthaseBool),' flux through the ATP synthase reaction')
%% 
% Display the sparse flux solution, but only the non-zero fluxes, above a specified 
% cutoff.

cutoff=feasTol;
for n=1:nRxn
    if abs(sparseFBAsolutionBounded.v(n))>cutoff
        formula=printRxnFormula(model, model.rxns{n}, 0);
        fprintf('%10g%15s\t%-60s\n',sparseFBAsolutionBounded.v(n),model.rxns{n}, formula{1});
    end
end
%% ANTICIPATED RESULTS
% In a model for flux balance analysis, there should be zero flux through the 
% ATP synthase reaction if all external reaction bounds are zero.
%% TROUBLESHOOTING
% If there is non-zero flux through the ATP synthase reaction, with all external 
% reaction bounds zero, then the bounds on one of the reactions in each of the 
% minimal sets needs to be set to eliminate flux in one direction. Each of the 
% minimal sets corresponds to net flux around a stoichiometrically balanced cycle, 
% which is thermodynamically infeasible [<#LyXCite-fleming_variational_2012 fleming_variational_2012>]. 
% Steady-state mass balance constraints do not enforce thermodynamic constraints. 
% In lieu of such constraints, the bounds on reactions can be set based on the 
% biochemical literature to eliminate net flux around a stoichiometrically balanced 
% cycle. In a model, with all external reactions blocked (bounds are set to zero), 
% maximising the ATP synthase reaction while minimising the cardinality of all 
% internal reactions, using sparse flux balance analysis can be used to find any 
% such cycle of minimal cardinality (minimal number of active reactions). By further 
% constraining the bounds to convert one reversible reaction in each such cycle 
% to an irreversible reaction, thermodynamically infeasible flux around cycles, 
% such as those involving the ATP synthase reaction, can be eliminated. The following 
% sections of this tutorial illustrate how to test different parts of the model 
% for thermodynamically infeasible flux through the ATP synthase reaction.
%% Testing for activity of ATP synthase with all exchanges closed and all internal reactions reversible
% Fully open all internal reactions

model.lb(model.SIntRxnBool)=-1000;
model.ub(model.SIntRxnBool)=1000;
%% 
% Run sparse flux balance analysis on the model with all exchanges closed and 
% all internal reactions reversible

sparseFBAsolutionUnBounded = optimizeCbModel(model, osenseStr, minNorm, allowLoops, zeroNormApprox);
%% 
% Check to see if there is a non-zero flux through the ATP synthase reaction

fprintf('%g%s\n',sparseFBAsolutionUnBounded.v(atpsynthaseBool),' flux through the ATP synthase reaction')
%% 
% Display the sparse flux solution, but only the non-zero fluxes, above a specified 
% cutoff.

cutoff=feasTol;
for n=1:nRxn
    if abs(sparseFBAsolutionUnBounded.v(n))>cutoff
        formula=printRxnFormula(model, model.rxns{n}, 0);
        fprintf('%10g%15s\t%-60s\n',sparseFBAsolutionUnBounded.v(n),model.rxns{n}, formula{1});
    end
end
%% ANTICIPATED RESULTS
% In a model for flux balance analysis, there might be non-zero flux through 
% the ATP synthase reaction if all external reaction bounds are zero and all internal 
% reactions reversible. This indicates the imporance of appropriately constrained 
% internal reaction bounds.
%% Testing for activity of ATP synthase with all exchanges closed and all transport reactions reversible
% Identify all of the transport reactions

allTransportRxnBool=transportReactionBool(model);
fprintf('%u%s\n',nnz(allTransportRxnBool),' transport reactions in total.');
%% 
% Revert to original Recon3.0model reaction bounds

model.lb=modelOrig.lb;
model.ub=modelOrig.ub;
%% 
% Open all transport reactions (which might include an external reaction, e.g., 
% a  biomass reaction)

model.lb(allTransportRxnBool)=-1000;
model.ub(allTransportRxnBool)=1000;
%% 
% Close all external reactions

model.lb(~model.SIntRxnBool)=0;
model.ub(~model.SIntRxnBool)=0;
%% 
% Run sparse flux balance analysis on the model with all exchanges closed

sparseFBAsolutionBounded = optimizeCbModel(model, osenseStr, minNorm, allowLoops, zeroNormApprox);
%% 
% Check to see if there is a non-zero flux through the ATP synthase reaction

fprintf('%g%s\n',sparseFBAsolutionBounded.v(atpsynthaseBool),' flux through the ATP synthase reaction')
%% 
% Display the sparse flux solution, but only the non-zero fluxes, above a specified 
% cutoff.

cutoff=feasTol;
for n=1:nRxn
    if abs(sparseFBAsolutionBounded.v(n))>cutoff
        formula=printRxnFormula(model, model.rxns{n}, 0);
        fprintf('%10g%15s\t%-60s\n',sparseFBAsolutionBounded.v(n),model.rxns{n}, formula{1});
    end
end
%% Testing for activity of ATP synthase with all exchanges closed and all mitochondrial transport reactions reversible
% Identify all of the transport reactions involving the cytoplasm and mitochondrial 
% matrix

originCompartment='c';
destinationCompartment='m';
unidirectionalBool=0;
cmTransportRxnBool=transportReactionBool(model,originCompartment,destinationCompartment,unidirectionalBool);
fprintf('%u%s\n',nnz(cmTransportRxnBool),' transport reactions involving the cytoplasm and mitochondrial matrix.');
%% 
% Revert to original Recon3.0model reaction bounds

model.lb=modelOrig.lb;
model.ub=modelOrig.ub;
%% 
% Open all transport reactions (which might include an external reaction, e.g., 
% a  biomass reaction)

model.lb(cmTransportRxnBool)=-1000;
model.ub(cmTransportRxnBool)=1000;
%% 
% Close all external reactions

model.lb(~model.SIntRxnBool)=0;
model.ub(~model.SIntRxnBool)=0;
%% 
% Run sparse flux balance analysis on the model 

sparseFBAsolutionBounded = optimizeCbModel(model, osenseStr, minNorm, allowLoops, zeroNormApprox);
%% 
% Check to see if there is a non-zero flux through the ATP synthase reaction

fprintf('%g%s\n',sparseFBAsolutionBounded.v(atpsynthaseBool),' flux through the ATP synthase reaction')
%% 
% Display the sparse flux solution, but only the non-zero fluxes, above a specified 
% cutoff.

cutoff=feasTol;
for n=1:nRxn
    if abs(sparseFBAsolutionBounded.v(n))>cutoff
        formula=printRxnFormula(model, model.rxns{n}, 0);
        fprintf('%10g%15s\t%-60s\n',sparseFBAsolutionBounded.v(n),model.rxns{n}, formula{1});
    end
end
%% Testing for activity of ATP synthase with all exchanges closed and all plasma membrane transport reactions reversible
% Identify all of the transport reactions across the plasma membrane

originCompartment='e';
destinationCompartment='c';
unidirectionalBool=0;
ecTransportRxnBool=transportReactionBool(model,originCompartment,destinationCompartment,unidirectionalBool);
fprintf('%u%s\n',nnz(ecTransportRxnBool),' transport reactions across the plasma membrane.');
%% 
% Revert to original Recon3.0model reaction bounds

model.lb=modelOrig.lb;
model.ub=modelOrig.ub;
%% 
% Open all transport reactions (which might include an external reaction, e.g., 
% a  biomass reaction)

model.lb(ecTransportRxnBool)=-1000;
model.ub(ecTransportRxnBool)=1000;
%% 
% Close all external reactions

model.lb(~model.SIntRxnBool)=0;
model.ub(~model.SIntRxnBool)=0;
%% 
% Run sparse flux balance analysis on the model 

sparseFBAsolutionBounded = optimizeCbModel(model, osenseStr, minNorm, allowLoops, zeroNormApprox);
%% 
% Check to see if there is a non-zero flux through the ATP synthase reaction

fprintf('%g%s\n',sparseFBAsolutionBounded.v(atpsynthaseBool),' flux through the ATP synthase reaction')
%% 
% Display the sparse flux solution, but only the non-zero fluxes, above a specified 
% cutoff.

cutoff=feasTol;
for n=1:nRxn
    if abs(sparseFBAsolutionBounded.v(n))>cutoff
        formula=printRxnFormula(model, model.rxns{n}, 0);
        fprintf('%10g%15s\t%-60s\n',sparseFBAsolutionBounded.v(n),model.rxns{n}, formula{1});
    end
end
%% Testing for activity of ATP synthase with all exchanges closed and peroxisomal transport reactions reversible
% Identify all of the transport reactions across the plasma membrane

originCompartment='c';
destinationCompartment='x';
unidirectionalBool=0;
cxTransportRxnBool=transportReactionBool(model,originCompartment,destinationCompartment,unidirectionalBool);
fprintf('%u%s\n',nnz(cxTransportRxnBool),' transport reactions across the peroxisome membrane.');
%% 
% Revert to original Recon3.0model reaction bounds

model.lb=modelOrig.lb;
model.ub=modelOrig.ub;
%% 
% Open all transport reactions (which might include an external reaction, e.g., 
% a  biomass reaction)

model.lb(cxTransportRxnBool)=-1000;
model.ub(cxTransportRxnBool)=1000;
%% 
% Close all external reactions

model.lb(~model.SIntRxnBool)=0;
model.ub(~model.SIntRxnBool)=0;
%% 
% Run sparse flux balance analysis on the model 

sparseFBAsolutionBounded = optimizeCbModel(model, osenseStr, minNorm, allowLoops, zeroNormApprox);
%% 
% Check to see if there is a non-zero flux through the ATP synthase reaction

fprintf('%g%s\n',sparseFBAsolutionBounded.v(atpsynthaseBool),' flux through the ATP synthase reaction')
%% 
% Display the sparse flux solution, but only the non-zero fluxes, above a specified 
% cutoff.

cutoff=feasTol;
for n=1:nRxn
    if abs(sparseFBAsolutionBounded.v(n))>cutoff
        formula=printRxnFormula(model, model.rxns{n}, 0);
        fprintf('%10g%15s\t%-60s\n',sparseFBAsolutionBounded.v(n),model.rxns{n}, formula{1});
    end
end
%% Testing for activity of ATP synthase with all exchanges closed and lysosomal transport reactions reversible
% Identify all of the transport reactions across the plasma membrane

originCompartment='c';
destinationCompartment='l';
unidirectionalBool=0;
clTransportRxnBool=transportReactionBool(model,originCompartment,destinationCompartment,unidirectionalBool);
fprintf('%u%s\n',nnz(clTransportRxnBool),' transport reactions across the lysosomal membrane.');
%% 
% Revert to original Recon3.0model reaction bounds

model.lb=modelOrig.lb;
model.ub=modelOrig.ub;
%% 
% Open all transport reactions (which might include an external reaction, e.g., 
% a  biomass reaction)

model.lb(clTransportRxnBool)=-1000;
model.ub(clTransportRxnBool)=1000;
%% 
% Close all external reactions

model.lb(~model.SIntRxnBool)=0;
model.ub(~model.SIntRxnBool)=0;
%% 
% Run sparse flux balance analysis on the model 

sparseFBAsolutionBounded = optimizeCbModel(model, osenseStr, minNorm, allowLoops, zeroNormApprox);
%% 
% Check to see if there is a non-zero flux through the ATP synthase reaction

fprintf('%g%s\n',sparseFBAsolutionBounded.v(atpsynthaseBool),' flux through the ATP synthase reaction')
%% 
% Display the sparse flux solution, but only the non-zero fluxes, above a specified 
% cutoff.

cutoff=feasTol;
for n=1:nRxn
    if abs(sparseFBAsolutionBounded.v(n))>cutoff
        formula=printRxnFormula(model, model.rxns{n}, 0);
        fprintf('%10g%15s\t%-60s\n',sparseFBAsolutionBounded.v(n),model.rxns{n}, formula{1});
    end
end
%% REFERENCES
% [fleming_cardinality_nodate] Fleming, R.M.T., et al., Cardinality optimisation 
% in constraint-based modelling: illustration with Recon 3D (submitted), 2017.
% 
% [<#LyXCite-sparsePaper sparsePaper>] Le Thi, H.A., Pham Dinh, T., Le, H.M., 
% and Vo, X.T. (2015). DC approximation approaches for sparse optimization. European 
% Journal of Operational Research 244, 26–46.
% 
% 
% 
%
##### SOURCE END #####
-->
</div></body></html>